/* 页面主体架构 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

li {
    list-style: none;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

body {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    overflow: hidden;
}

.status-bar {
    width: 260px;
    background-color: var(--color-barleft-);
    color: var(--color-barleft-text);
}

.chat-view {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    position: relative;
}

/* 中间对话框部分 */
.chat-view .container-box {
    height: 100%;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 0 10px;
}

.chat-view .chat-panel {
    height: calc(100% - (200px + 50px));
    background-color: var(--theme-main);
    position: relative;
}

.chat-view .chat-panel .chatpanel-list {
    width: 100%;
    height: 100%;
    position: relative;
}

.chat-view .chat-panel .scroll-chatpanel {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
}

/* 回到底部按钮 */
.chat-panel .backbtm {
    position: absolute;
    width: 80px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    bottom: 3px;
    left: calc(50% - 40px);
    font-size: 0.8em;
    padding: 3px 5px;
    box-sizing: initial;
    border-radius: 3px;
    cursor: pointer;
    color: var(--color-btn-gotobottom-color);
    background-color: var(--color-btn-gotobottom-bg);
    display: none;
    z-index: 10;
}

.chat-panel .backbtm:hover {
    color: var(--color-link);
}

.chat-view .chat-panel .chat-box {
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 10px;
}

.chat-view .title-box {
    height: 50px;
    line-height: 50px;
    background-color: var(--theme-main);
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 0 10px;
}

.chat-view .title-box > .name-block {
    line-height: inherit;
}

.chat-view .title-box > .order-block {
    line-height: inherit;
    text-align: right;
}

.chat-view .title-box > .order-block > .btn {
    font-size: 1.4em;
    text-align: right;
    width: auto;
    padding: 0;
    position: relative;
}

.chat-view .title-box > .order-block #more-btn .menus {
    background-color: var(--color-menu-bg);
    color: var(--color-character-name);
    border-radius: 5px;
    display: none;
    position: absolute;
    top: calc(100% + 0px);
    right: 5px;
    z-index: 1;
}

.chat-view .title-box > .order-block #more-btn .menus li {
    padding: 5px 10px;
    font-size: 0.5em;
    overflow: hidden;
}
.chat-view .title-box > .order-block #more-btn .menus li:hover {
    color: var(--color-menu-hover-color);
}

/* .chat-view .title-box > .order-block > #more-btn>.icon:focus+.menus{
    display: block;
} */

.chat-view .title-box .aiName {
    font-weight: 500;
    line-height: inherit;
    font-size: 1.1em;
}

.chat-view .title-box .entering {
    font-size: 1em;
}

.chat-view .quesion-panel {
    min-height: 100px;
    max-height: 500px;
    height: 200px;
    background-color: var(--theme-main);
    border-top: 1px solid #ccc;
    /* 拖放上边框调整占比 */
    resize: vertical;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    position: relative;
    padding-top: 3px;
}

.chat-view .quesion-panel .rezise {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    cursor: ns-resize;
    background-color: transparent;
}

.chat-view .quesion-panel .input-block {
    width: 100%;
    height: 100%;
    border-style: none;
    box-sizing: border-box;
    box-sizing: border-box;
    padding-bottom: 30px;
}

.chat-view .quesion-panel .sendbtn-block {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding-right: 10px;
    position: absolute;
    bottom: 0px;
    left: 0px;
}

.chat-view .quesion-panel .sendbtn-block > .left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    flex-basis: 50%;
}

.chat-view .quesion-panel .sendbtn-block > .right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    flex-basis: 50%;
}

.chat-view .quesion-panel .sendbtn-block .left .rem-len {
    font-size: 0.8em;
    color: #999;
    margin-left: 5px;
}

.chat-view .quesion-panel .sendbtn-block .btn {
    margin-left: 5px;
}

.chat-view .quesion-panel #quesion-text {
    width: 100%;
    height: 100%;
    border-style: none;
    box-sizing: border-box;
    resize: none;
    outline: none;
    padding-left: 10px;
    padding-top: 10px;
    font-family: 'Microsoft YaHei', '微软雅黑', 'STHeiti', '华文细黑', 'WenQuanYi Micro Hei', 'SimSun', '宋体', 'NSimSun', '新宋体', 'FangSong', '仿宋', 'KaiTi', '楷体', 'Microsoft YaHei', '微软雅黑', 'STHeiti', '华文细黑', 'WenQuanYi Micro Hei', 'SimSun', '宋体', 'NSimSun', '新宋体', 'FangSong', '仿宋', 'KaiTi', '楷体', sans-serif;
}

/* 对话框 */

.chat-panel .chat-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    margin-top: 20px;
}

.chat-panel .chat-item .avatar {
    flex-basis: 50px;
}

.chat-panel .chat-item .content {
    flex-grow: 1;
}

.chat-panel .chat-item.left .content {
    text-align: left;
    margin-left: 15px;
}

.chat-panel .chat-item.right .content {
    text-align: right;
    margin-right: 15px;
}

/* 头像 */

.chat-panel .chat-item .avatar .head-img {
    width: 40px;
    height: 40px;
    border-style: none;
}

/* 微信气泡效果 */
.chat-panel .chat-item .content .bubble {
    width: auto;
    font-size: 0.9em;
    padding: 10px;
    border-radius: 5px;
    min-height: 40px;
    display: inline-block;
    position: relative;
    overflow-x: auto;
    max-width: 1045px;
}

.chat-panel .chat-item .content .bubble.fadein {
    /* 上浮渐入动画效果 */
    animation: bubble_in 0.3s ease-in-out;
}

@keyframes bubble_in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0px);
    }
}

.chat-panel .chat-item .bubble::before {
    /* 绘制小三角 */
    content: '';
    position: absolute;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid transparent;
    border-left: 10px solid transparent;
}

.chat-panel .chat-item.left .bubble::before {
    border-left: none;
    border-right-color: var(--color-bubble-bg-left);
    left: -8px;
    right: auto;
}
.chat-panel .chat-item.right .bubble{
    overflow: hidden;
}
.chat-panel .chat-item.right .bubble::before {
    border-right: none;
    border-left-color: var(--color-bubble-bg-right);
    left: auto;
    right: -8px;
}

/* 发送失败 */
.chat-panel .chat-item .content .bubble .fail-dot {
    display: block;
    position: absolute;
    height: 20px;
    width: 20px;
    line-height: 20px;
    text-align: center;
    top: calc(50% - 10px);
    left: -30px;
    cursor: pointer;
    background-color: #f10303;
    color: white;
    border-radius: 50%;
}

.chat-panel .chat-item .content .bubble .fail-dot::before {
    content: '!';
    font-size: 1.1em;
    font-weight: bold;
}

.chat-panel .chat-item .bubble .msg-content {
    text-align: left;
    box-sizing: border-box;
}

/* 气泡底色 */
.chat-panel .chat-item.left .bubble {
    background-color: var(--color-bubble-bg-left);
    color: var(--color-bubble-text-left);
}

.chat-panel .chat-item.right .bubble {
    background-color: var(--color-bubble-bg-right);
    color: var(--color-bubble-text-right);
}

/* 时间点 */
.chat-item.type-time {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-item.type-time .value {
    background-color: var(--color-bubble-time-bg);
    color: var(--color-bubble-time-text);
    border-radius: 3px;
    font-size: 0.8em;
    padding: 3px 8px;
}

/* markdown 内部样式微调 */
body .markdown-body {
    color: var(--color-bubble-text-left);
    background-color: var(--color-bubble-bg-left);
    font-size: 1em;
}

body .markdown-body ul,
body .markdown-body ol {
    margin-left: 20px;
    padding: 0;
}

body .markdown-body pre {
    margin: 0 5px;
    background-color: var(--markdown-pre-bg);
    font-size: 1.1em;
    position: relative;
}

body .markdown-body pre .func-btn {
    position: absolute;
    display: block;
    top: 3px;
    right: 5px;
    z-index: 1;
    color: var(#999);
    background-color: transparent;
    border-style: none;
    cursor: pointer;
    font-size: 0.9em;
}

body .markdown-body pre .code-name {
    position: absolute;
    display: block;
    top: 0px;
    left: 5px;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.8em;
    border-style: none;
    height: 20px;
    height: 20px;
    text-align: center;
    border-radius: 0px 0px 3px 3px;
    padding: 0 5px;
}

body .markdown-body pre .func-btn:hover {
    color: var(--color-link);
}

body .markdown-body tt,
.markdown-body code,
.markdown-body samp {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace !important;
}

.status-bar .list-block {
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}

.status-bar .scoll-list {
    overflow-y: auto;
    overflow-x: hidden;
    /* height: 90%; */
    box-sizing: border-box;
    position: relative;
    flex-grow: 1;
}

.status-bar .btm-block {
    flex-shrink: 0;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-size: 0.8em;
}

.status-bar .scoll-list::-webkit-scrollbar-thumb {
    background-color: var(--color-character-scrollbar-thumb);
}

/*性格列表*/
.status-bar .characters {
    padding-right: 10px;
    padding-left: 5px;
}

.status-bar .characters .character-item {
    color: var(--color-barleft-text);
    border: 1px solid transparent;
    border-radius: 5px;
    height: 60px;
    cursor: pointer;
    font-size: 0.9em;
    transition: border-color 0.2s ease-in-out;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    margin-bottom: 5px;
    /* box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.6); */
    transition: all 0.2s ease-in-out;
    background-color: var(--color-character-bg);
}

.status-bar .characters .character-item:last-child {
    margin-bottom: 0px;
}

.status-bar .characters > .character-item:hover {
    border-color: var(--color-character-hover-border);
}

.status-bar .characters .character-item.active {
    background-color: var(--color-character-active-bg);
}

.status-bar .characters .character-item .time {
    position: absolute;
    right: 5px;
    top: 2px;
    font-size: 0.8em;
    color: var(--color-character-time);
    display: block;
    text-align: right;
}

.status-bar .characters > .character-item .icon {
    font-size: 1.2em;
    display: inline-block;
    margin-right: 5px;
}

/* 头像区域 */
.status-bar .characters .character-item .head-box {
    flex-basis: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.status-bar .characters .character-item .head-box img {
    width: 70%;
    border-radius: 5px;
    box-shadow: 3px 3px 2px rgba(0, 0, 0, 0.5);
}

/* 信息区域 */

.status-bar .characters .character-item .info-box {
    flex-grow: 1;
    padding-left: 5px;
    padding-top: 6px;
    position: relative;
}

.status-bar .characters .character-item .info-box .name {
    font-size: 1.1em;
    color: var(--color-character-name);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-bar .characters .character-item .info-box .desc {
    font-size: 0.8em;
    color: var(--color-character-desc);
    margin-top: 10px;
    max-width: 175px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
